<template>
  <div class="search">
    <f-form ref="form" :action="api.viponly" :form-key="this.formItem.viponlyId" >
      <f-form-item label="是否需要预约（1不需要，2需要）"  name="isAppoint" dataType="number"   :value="formItem.isAppoint" />
      <f-form-item label="贵宾厅通道简介"  name="viponlyDesc" dataType="${formField.dataType}"   :value="formItem.viponlyDesc" />
      <f-form-item label="贵宾通道地址"  name="viponlyAddress" dataType="${formField.dataType}"   :value="formItem.viponlyAddress" />
      <f-form-item label="通道电话"  name="viponlyPhone" dataType="${formField.dataType}"   :value="formItem.viponlyPhone" />
      <f-form-item label="温馨提示"  name="viponlyTips" dataType="${formField.dataType}"   :value="formItem.viponlyTips" />
      <f-form-item label="排序"  name="viponlySort" dataType="number"   :value="formItem.viponlySort" />
      <f-form-item label="所属机场"  name="airportId" dataType="${formField.dataType}"   :value="formItem.airportId" />
      <f-form-item label="预约控制"  name="maxTime" dataType="number"   :value="formItem.maxTime" />
      <f-form-item label="营业时间"  name="viponlyTime" dataType="${formField.dataType}"   :value="formItem.viponlyTime" />
      <f-form-item label="营业起时间"  name="startTime" dataType="${formField.dataType}"   :value="formItem.startTime" />
      <f-form-item label="营业止时间"  name="endTime" dataType="${formField.dataType}"   :value="formItem.endTime" />
      <f-form-item label="航站楼信息"  name="terminalInfo" dataType="${formField.dataType}"   :value="formItem.terminalInfo" />
      <f-form-item label="（1国内出发/2国际出发）"  name="departType" dataType="number"   :value="formItem.departType" />
      <f-form-item label="首字母"  name="firstLetter" dataType="${formField.dataType}"   :value="formItem.firstLetter" />
      <f-form-item label="推荐购卡的卡种"  name="recommendVipcardId" dataType="${formField.dataType}"   :value="formItem.recommendVipcardId" />
    </f-form>
  </div>
</template>
<script>
  import api from './js/api'
  export default {
    name: 'viponlyForm',
    props: {},
    data() {
      return {
        refs:this.$refs,
        api:  Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          viponlyId: '',
          isAppoint: '',
          viponlyDesc: '',
          viponlyAddress: '',
          viponlyPhone: '',
          viponlyTips: '',
          viponlySort: '',
          airportId: '',
          maxTime: '',
          viponlyTime: '',
          startTime: '',
          endTime: '',
          terminalInfo: '',
          departType: '',
          firstLetter: '',
          recommendVipcardId: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.viponlyId) {
          let params={
              viponlyId:data.viponlyId
          }
          this.refs['form'].getDetails(params,(data)=>{
             this.formItem=data
             this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({  }, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
